	function changePassword(){	
		if (validateChangePassword()){
			hideDiv("changePassError");
			var addParams = "NEWPASS="+trim(document.getElementById("newPassword").value);
			addParams += "&COMMAND=CHANGEPASSTEMPORAL";
			addParams += "&CUENTA=" + UNIQUE_ID;
			addParams += "&TOKEN=" + TOKEN;
			addParams += "&OBJETIVO=" + OBJETIVO;
			addParams += "&ESFLOTA=" + ESFLOTA;			
    			if (msie) 
            			reqHandlerPassword = new ActiveXObject("Microsoft.XMLHTTP");
        		else
            			reqHandlerPassword = new XMLHttpRequest();
            		reqHandlerPassword.onreadystatechange = OnReadyStateChangePassword;    
            		reqHandlerPassword.open("POST", "sections/queryConfig.php", true);
            		reqHandlerPassword.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	    		reqHandlerPassword.send(addParams);
		}
	}
	
	function OnReadyStateChangePassword(){
		ready = reqHandlerPassword.readyState;
		if (ready == 4) {
			if (reqHandlerPassword.responseText != 'undefined') {	
				if (reqHandlerPassword.responseText == '') {
				   location.href='welcome.php?error=17';
				} else {
				   document.getElementById("changePassError").innerHTML = reqHandlerPassword.responseText;
				   showDiv("changePassError");
				}
				document.getElementById("newPassword").value = '';
				document.getElementById("repeatPassword").value = '';	
			}
		}
	}
	
	
	var reqHandlerPassword;
    function validateChangePassword(){
		hideDiv('changePassError');
		document.getElementById('changePassError').innerHTML = '';
		var errorMsg = '';
		var newPassword = document.getElementById('newPassword').value;
		var repeatPassword = document.getElementById('repeatPassword').value;	

		if (trim(newPassword)!=''){
			if (!_validString(newPassword))
				errorMsg += "El campo 'Nuevo Password' no acepta caracteres especiales.<br>";	
			else if (!_validString(repeatPassword))
					errorMsg += "El campo 'Repita Nuevo Password' no acepta caracteres especiales.<br>";
				 else if(newPassword!=repeatPassword)
				 		errorMsg += "Los campos 'Nuevo Password' y 'Repita Nuevo Password' deben coincidir.<br>";
					  else {
						 document.getElementById("newPassword").value = calcMD5(newPassword);
						 document.getElementById("repeatPassword").value = calcMD5(repeatPassword);
					  }					  
			}			
		else
			errorMsg += "El campo 'Nuevo Password' es obligatorio.<br>";
		
		if (errorMsg == '')
			return true;
		document.getElementById("changePassError").innerHTML = errorMsg;
		showDiv("changePassError");
		return false;	
	}	
	
	
function showDiv(divId) {
  		document.getElementById(divId).style.display = "block";
	}
 
	
function hideDiv(divId) {
  		document.getElementById(divId).style.display = "none";
	}	